package com.huike.clues.mapper;

import com.huike.clues.domain.TbClue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import com.huike.clues.domain.vo.IndexStatisticsVo;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Select;


/**
* @author 93238
* @description 针对表【tb_clue(线索)】的数据库操作Mapper
* @createDate 2023-10-12 06:35:46
* @Entity com.huike.clues.domain.TbClue
*/
@Mapper
public interface TbClueMapper extends BaseMapper<TbClue> {

    TbClue selectTbClueByPhone(String phone);

    int setTransfer(@Param("id") Long id, @Param("status") String status);

    void updateClueEndTimeById(@Param("id")Long id,@Param("endTime") Date endTime);

    int resetNextTimeAndStatus(@Param("id") Long id, @Param("status") String status);

    TbClue selectTbClueById(Long id);

    int removeClueByFalseClue(Long id);

    int updateTbClue(TbClue tbClue);
    //根据渠道活动统计
    Map<String, Object> countByActivity(TbClue tbClue);

    List<Map<String, Object>> cluesStatistics(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);

    Integer countAllClues(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);

    Integer effectiveCluesNums(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);

    List<TbClue> selectTbClueForReport(TbClue tbClue);

    List<Map<String, Object>> countAllClueByUser(@Param("indexVo") IndexStatisticsVo indexStatisticsVo);

    List<TbClue> selectTbClueList(TbClue tbClue);

    void addClue(TbClue tbClue);

    @Select("select * from tb_clue where phone = #{phone}")
    TbClue selectTbCluePhone(String phone);

    List<TbClue> pool(TbClue tbClue);

    void updateClue(TbClue tbClue);

}




